import http from "@/api";
import { AddTypeParam ,EditTypeParam, GetTypeParam,TypeListType} from "@Tea/model";

const typeManageHttp = {
  // 获取类别列表
  getTypeList: (params: GetTypeParam) => http<TypeListType[]>({
    method: "post",
    url: "/admin/typeManage/typeList",
    params
  }),
  // 新增类别
  addType: (params: AddTypeParam) => http<null>({
    method: "post",
    url: "/admin/typeManage/addType",
    params
  }),
  // 编辑类别
  editType: (params: EditTypeParam) => http<null>({
    method: "post",
    url: "/admin/typeManage/editType",
    params
  }),
  // 删除类别
  delType: (typeId: number) => http<null>({
    method: "delete",
    url: `/admin/typeManage/delType?typeId=${typeId}`,
  }),
}

export default typeManageHttp